<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * requestPost
 *
 * Returns TRUE or FALSE
 *
 * @access	public
 * @return	boolean
 */
if ( ! function_exists('sqlTimestampToHuman'))
{
    function sqlTimestampToHuman($sqlTimestamp, $format = 'slovak', $seconds = false)
    {
        $dateAndTime = explode(" ", $sqlTimestamp);
        $dateArr = explode("-", $dateAndTime[0]);
        $timeArr = explode(":", $dateAndTime[1]);
        $output = "";
        switch($format){
            case 'slovak':
                $output = "$timeArr[0]:$timeArr[1]";
                if($seconds)
                    $output .= ":$timeArr[2]";
                $output .= " $dateArr[2].$dateArr[1].$dateArr[0]";
                break;
            case 'english':
                $output = "$timeArr[0]:$timeArr[1]";
                if($seconds)
                    $output .= ":$timeArr[2]";
                $output .= " $dateArr[1]/$dateArr[2]/$dateArr[0]";
                break;
        }
        
        return $output;
    }
}

/**
 * requestGet
 *
 * Returns TRUE or FALSE
 *
 * @access	public
 * @return	boolean
 */
if ( ! function_exists('requestGet'))
{
    function requestGet()
    {
        return $_SERVER['REQUEST_METHOD'] == 'GET';
    }
}

?>
